﻿using System.ComponentModel;
using System.Windows.Forms;
using HR60_PanelSoft.View.Base;
using System.Collections.Generic;

namespace HR60_PanelSoft.View.Controls
{
    //GC: [g1]Bug:2189/2190[TitleTextBox]
    //GC: [g2]优化：将核心的基础控件传递到外层[TitleTextBox]
    public partial class TitleTextBox : BaseFormControl
    {
        public TitleTextBox()
        {
            InitializeComponent();

            /* [g1.s1]重定义ValueChanged事件 */
			//txtValue.ValueChanged +=new System.EventHandler(this.valueChange);
            //txtValue.ValueChanged += new ValueChangedHandler(this.valueChange);
            txtValue.ValueChanged += new ValueChangedHandler((object sender, ValueChangedEventArgs vcea) =>
                {
                    vcea.Type = EventType.TitleTextBox;
                    valueChange(sender, vcea);
                });
            /* end of [g1.s1] */
        }

		[Browsable(true)]
		[Description("标题"), Category("String"), DefaultValue("标题")]
		public string Title
		{
			get
			{
				return lblTitle.Text;
			}
			set
			{
				lblTitle.Text = value;
			}
		}

		// 重写Value属性
		public override object Value
		{
			get
			{
				return txtValue.Value;
			}
			set
			{
				txtValue.Value = value;
			}
		}



        /* [g2.s1] */

        public override List<Control> GetCoreControls()
        {
            List<Control> rst = new List<Control>();
            rst.Clear();
            rst.AddRange(txtValue.GetCoreControls());
            
            return rst;
        }

        /* end of [g2.s1] */
	}
}
